package com.googlecode.webduff.authentication;

import com.googlecode.webduff.WebDuffConfiguration;
import com.googlecode.webduff.WebdavStatus;
import com.googlecode.webduff.authentication.provider.Credential;
import com.googlecode.webduff.exceptions.MethodResponseError;


public class DummyWebdavAuthentication implements WebdavAuthentication {
	
	public void init(WebDuffConfiguration config) {
		
	}
	
	public void authenticate(Credential credential) throws MethodResponseError {
		if(!(credential.getUsername().equals("foo") && credential.checkPassword("bar"))) {
			throw new MethodResponseError(WebdavStatus.SC_UNAUTHORIZED);
		}
	}

}